package com.dubbo.dubboserver.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.api.UserService;
import com.dubbo.dubboserver.dao.UserInfoDAO;
import com.entity.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;

@Service
public class MyMethodImp implements UserService {

    @Autowired
    private UserInfoDAO userInfoDAO;


    @Override
    public void register(UserInfo userInfo){

//        if (StringUtils.isBlank(userInfo.getUsername())) {
//            throw new MyExecption("用户名不能为空");
//        }
//        if (StringUtils.isBlank(userInfo.getPassword())) {
//            throw new MyExecption("密码不能为空");
//        }
        //userInfo.setPassword(CryptographyUtil.md5(userInfo.getUsername(),userInfo.getPassword()));

        userInfoDAO.insert(userInfo);
    }
}
